package com.cxyzy.demo

import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_first.*

class FirstActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_first)
        textView.setOnClickListener {
            val intent = Intent(this, SecondActivity::class.java)
            //传递字符串类型
            intent.putExtra("name", "程序园中猿")
            //传递整型
            intent.putExtra("age", 99)
            //传递布尔
            intent.putExtra("isOK", true)
            startActivity(intent)
        }
    }
}
